<template>
    <el-dialog close-on-press-escape draggable :close-on-click-modal="false" :modal="true" align-center destroy-on-close
        v-model="store.dialog.archive.addOrEdit.show"
        :title="store.dialog.archive.addOrEdit.data.isEdit ? '新建著录' : '编辑著录'" width="800" style="height: auto;">
        <div class="dialog-container">
            <div class="section section-info">
                <div class="section-header">
                    <flexBox class="header-title">
                        <span>信息</span>
                    </flexBox>
                    <flexBox class="header-buttons">
                        <el-button-group>
                            <el-button type="primary" size="small">
                                <flexBox gap="5px" alignItems="center" justifyContent="center">
                                    <cSvg color="white" name="save" />
                                    <span class="header-button-text">保存</span>
                                </flexBox>
                            </el-button>
                            <el-button type="primary" size="small">
                                <flexBox gap="5px" alignItems="center" justifyContent="center">
                                    <cSvg color="white" name="addCircle" />
                                    <span class="header-button-text">添加并保存</span>
                                </flexBox>
                            </el-button>
                        </el-button-group>
                    </flexBox>
                </div>
                <div class="section-body">
                    <CForm class="form-container"></CForm>
                </div>
            </div>
            <div class="section section-directory">
                <div class="section-header">
                    <flexBox class="header-title">
                        <span>卷内目录</span>
                    </flexBox>
                    <flexBox class="header-buttons">
                        <el-button-group>
                            <el-button type="primary" size="small">
                                <flexBox gap="5px" alignItems="center" justifyContent="center">
                                    <cSvg color="white" name="addCircle" />
                                    <span class="header-button-text">添加</span>
                                </flexBox>
                            </el-button>
                            <el-button type="primary" size="small">
                                <flexBox gap="5px" alignItems="center" justifyContent="center">
                                    <cSvg color="white" name="removeCircle" />
                                    <span class="header-button-text">删除</span>
                                </flexBox>
                            </el-button>
                        </el-button-group>
                    </flexBox>
                </div>
                <div class="section-body">

                </div>
            </div>
        </div>
    </el-dialog>
</template>

<script setup>
import { onMounted } from "vue";
import { useStore } from "../modules/store";
const store = useStore();

import flexBox from "./flexBox.vue";
import cSvg from "./cSvg.vue";
import CForm from "./cForm.vue";

onMounted(async () => { });
</script>

<style scoped>
.dialog-container {
    width: 100%;
    height: 600px;
}

.section {
    width: 100%;
    position: relative;
    border: 1px solid #409eff;
    border-radius: 5px;
    overflow: hidden;
}

.section-info {
    height: 400px;
}

.section-directory {
    height: 195px;
    margin-top: 5px;
}

.section-header {
    width: 100%;
    padding: 5px;
    background-color: #409eff;
    position: absolute;
    left: 0;
    top: 0;
    height: 34px;
}

.header-title {
    height: 24px;
    width: max-content;
    font-size: 14px;
}

.header-title span {
    color: white;
    font-weight: bold;
}

.header-buttons {
    height: 24px;
    float: right;
}

.header-button-text {
    color: white;
}

.section-body {
    width: 100%;
    height: calc(100% - 34px);
    position: absolute;
    padding: 5px;
    left: 0;
    bottom: 0;
}

.form-container {
    width: 100%;
    height: 100%;
}
</style>